package com.ak.cluster;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;

public abstract class Game implements ApplicationListener {

	Screen screen;
	OrthographicCamera rCamera;
	public void setScreen(Screen lScreen)
	{
		screen.pause();
		screen.dispose();
		screen = lScreen;
	}
	public void setRatioCamera(OrthographicCamera lCam)
	{
		rCamera = lCam;
	}
	public abstract Screen getStartScreen();
	
    @Override
    public void create() {
    	screen = getStartScreen();
    	//I
    }

    @Override
    public void dispose() { 
    	screen.dispose();
    }

    @Override
    public void pause() { 
    	screen.pause();
    }

    @Override
    public void render() {
    	screen.update(Gdx.graphics.getDeltaTime());
    	screen.present(Gdx.graphics.getDeltaTime());            		
    }

    @Override
    public void resize(int width, int height) {         
    	float aspectRatio = (float) width / (float) height;
    	rCamera = new OrthographicCamera(2f * aspectRatio, 2f);
    	}

    @Override
    public void resume() { 
    	screen.resume();
    }

}
